package com.uzai.console.dto.user.useraccdetail;

import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.uzai.console.common.utils.DateUtil;
import com.uzai.console.dto.QueryParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author liuqi
 * @date 2021年08月27日 15:45
 */
@ApiModel("用户账户明细分页查询")
public class UserAccDetailQuery extends QueryParam {
    @ApiModelProperty("用户id")
    private Long userId;
    @ApiModelProperty("订单编号/商户订单号")
    private String orderIdTradeno;
    @ApiModelProperty("变更金额")
    private Double changeBal;
    @ApiModelProperty("月份(参数格式字符串yyyy-MM)")
    private String queryMonth;
    @ApiModelProperty(value = "查询月份第一天", hidden = true)
    private Integer queryMonthStartTime;
    @ApiModelProperty(value = "查询月份最后一天", hidden = true)
    private Integer queryMonthEndTime;
    @ApiModelProperty("查询开始时间")
    private Integer queryStartTime;
    @ApiModelProperty("查询结束时间")
    private Integer queryEndTime;
    @ApiModelProperty("明细类型")
    private Integer type;
    @ApiModelProperty("订单编号")
    private String orderId;
    @ApiModelProperty("来源会员id")
    private Long sourceUserId;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getOrderIdTradeno() {
        return orderIdTradeno;
    }

    public void setOrderIdTradeno(String orderIdTradeno) {
        this.orderIdTradeno = orderIdTradeno;
    }

    public Double getChangeBal() {
        return changeBal;
    }

    public void setChangeBal(Double changeBal) {
        this.changeBal = changeBal;
    }

    public String getQueryMonth() {
        return queryMonth;
    }

    public void setQueryMonth(String queryMonth) {
        this.queryMonth = queryMonth;
    }

    public Integer getQueryMonthStartTime() {
        //如果查询月份不为空，则开始时间为当月得第一天
        if(StringUtils.isNotBlank(queryMonth)){
            queryMonthStartTime =  DateUtil.getStartTimeOrEndTimeByMonth(queryMonth, 0);
        }
        return queryMonthStartTime;
    }

    public void setQueryMonthStartTime(Integer queryMonthStartTime) {
        this.queryMonthStartTime = queryMonthStartTime;
    }

    public Integer getQueryMonthEndTime() {
        //如果查询月份不为空，则开始时间为当月得第一天
        if(StringUtils.isNotBlank(queryMonth)){
            queryMonthEndTime =  DateUtil.getStartTimeOrEndTimeByMonth(queryMonth, 1);
        }
        return queryMonthEndTime;
    }

    public void setQueryMonthEndTime(Integer queryMonthEndTime) {
        this.queryMonthEndTime = queryMonthEndTime;
    }


    public Integer getQueryStartTime() {
        return queryStartTime;
    }

    public void setQueryStartTime(Integer queryStartTime) {
        this.queryStartTime = queryStartTime;
    }

    public Integer getQueryEndTime() {
        return queryEndTime;
    }

    public void setQueryEndTime(Integer queryEndTime) {
        this.queryEndTime = queryEndTime;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Long getSourceUserId() {
        return sourceUserId;
    }

    public void setSourceUserId(Long sourceUserId) {
        this.sourceUserId = sourceUserId;
    }
}
